package cn.stylefeng.guns.modular.robot.cmd.impl;

import cn.stylefeng.guns.modular.robot.cmd.abs.AbstractCmd;
import cn.stylefeng.guns.modular.robot.utils.RobotUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.telegram.telegrambots.bots.TelegramLongPollingBot;
import org.telegram.telegrambots.meta.api.objects.Update;

@Slf4j
@Service
@Transactional
public class CmdGroupId extends AbstractCmd {

    @Override
    public void exec(Update update, TelegramLongPollingBot bot) {
        Long chatId = update.getMessage().getChatId();
        RobotUtils.sendText(chatId, update.getMessage().getChat().getId() + "", bot);
    }

    @Override
    public String getCmdName() {
        return "获取群ID";
    }

    @Override
    public String getDescribe() {
        return "获取群ID                    获取本群groupid\n";
    }
}
